<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
    padding: 0;
    margin: 0;
}


#countdownLink{

    display: block;
    width: 191px;
    height: 261px;

    background-image: url(c.png);

    text-decoration: none;
}


#seckill{

    width:100%;

    font-family: "黑体";
    font-weight: bold;
    color:white;
    font-size: 32px;

    text-align: center;

    margin: 40px auto;
}


#countdownLink::before,
#countdownLink::after{
    content:"";
    display: table;
    clear: both;
}


#specialTime{

    width:100%;
    height:20px;

    text-align: center;

    font-size: 15px;
    color:white;
    font-family: "黑体";
    font-weight: bold;
    margin: 75px auto 20px;
}
#specialTime #strong{
    display: inline-block;
    font-size: 23px;
}
#specialTime #nomal{
    display: inline-block;
    vertical-align: 3px;
}
#leftTime{
    width: 100%;
    text-align: center;
}
#hour,#minute,#second{
    width: 30px;
    height: 30px;
    background-color: black;
    color:white;
    font-family: "黑体";
    font-weight: bold;
    font-size:25px;
    text-align: center;
    display: inline-block;
    margin:0 5px;
    position: relative;
} 
#hour::after,#minute::after{
    content: ":";
    position: absolute;
    left: 32px;
    top: -3px;
}
    </style>
</head>
<body>
    <a href="https://miaosha.jd.com" id="countdownLink">
        <div id="seckill">京东秒杀</div>
        <div id="specialTime"></div>
        <div id="leftTime">
            <span id="hour">00</span>
            <span id="minute">00</span>
            <span id="second">00</span>
        </div>
    </a>
    <script>
        $(document).ready(function () {
            var oDate = new Date();
            var nowTime = oDate.getTime(); //现在的毫秒数
            oDate.setDate(oDate.getDate() + 1); // 设定截止时间为第二天
            var targetDate = new Date(oDate.toLocaleDateString());
            run(targetDate);
        });
     
        function run(enddate) {
            getDate(enddate);
            setInterval("getDate('" + enddate + "')", 500);
        }
     
        function getDate(enddate) {
            var oDate = new Date(); //获取日期对象
     
            var nowTime = oDate.getTime(); //现在的毫秒数
            var enddate = new Date(enddate);
            var targetTime = enddate.getTime(); // 截止时间的毫秒数
            var second = Math.floor((targetTime - nowTime) / 1000); //截止时间距离现在的秒数
     
            var day = Math.floor(second / 24 * 60 * 60); //整数部分代表的是天；一天有24*60*60=86400秒 ；
            second = second % 86400; //余数代表剩下的秒数；
            var hour = Math.floor(second / 3600); //整数部分代表小时；
            second %= 3600; //余数代表 剩下的秒数；
            var minute = Math.floor(second / 60);
            second %= 60;
            var spanH = $('.se-txt')[0];
            var spanM = $('.se-txt')[1];
            var spanS = $('.se-txt')[2];
     
            spanH.innerHTML = tow(hour);
            spanM.innerHTML = tow(minute);
            spanS.innerHTML = tow(second);
        }
     
        function tow(n) {
            return n >= 0 && n < 10 ? '0' + n : '' + n;
        }
    </script>
</body>
</html>